package com.javapda.c328r;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;

import com.javapda.camera.CameraInfo;
import com.javapda.util.FileUtil;

public class C328rCameraInfo implements CameraInfo {

	private static C328rCameraInfo cinfo;
	private Map capabilities;
	private C328rCameraInfo() {
		Properties props = FileUtil.getPropertiesFromClasspathFile("com/javapda/c328r/c328.capabilities.properties");
		capabilities = new TreeMap();
		for (Iterator iterator = props.keySet().iterator(); iterator.hasNext();) {
			String key = (String) iterator.next();
			capabilities.put(key, props.getProperty(key));
		}
		
	}
	public static C328rCameraInfo getInstance() {
		if ( cinfo == null ) {
			cinfo = new C328rCameraInfo();
		}
		return cinfo;
	}
	public Map getCapabilities() {
		return capabilities;
	}

	public String getDescription() {
		return "C328R JPEG Compression VGA Camera Module";
	}

	public URL getUrl() {
		URL url = null;
		try {
			url = new URL("http://www.electronics123.com/s.nl/it.A/id.2581/.f");
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
		return url;
	}

}
